package com.sinosoft.mcp.server.mysql.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class ProductService {

    public record Product(Integer id, String name, BigDecimal price) {
    }

    @Tool(description = "Get list of Products by name")
    public List<Product> getProducts(String name) {
        // 这里模拟查询DB操作
        return List.of(new Product(1, "Widget", BigDecimal.valueOf(19.99)));
    }

}
